package edu.kit.aifb.swala.main;


import java.io.IOException;
import java.net.URISyntaxException;
import java.util.logging.Logger;

import edu.kit.aifb.swala.data.crawler.LDCrawler;
import edu.kit.aifb.swala.data.retriever.LDRetriever;


public class Main {
	
	private final static Logger _log = Logger.getLogger(Main.class.getSimpleName());


	public static void main(String[] args) {
		_log.info("Starting Crawler.");
		String seedURI = "http://www.w3.org/People/Berners-Lee/card";
		int numberOfTreads = 2;
		int maxURIs = 1;
		String outputFilename = "data-1.nq";
		LDCrawler crawler = new LDCrawler(seedURI,numberOfTreads,maxURIs, outputFilename);
		try {
			crawler.crawl();
		} catch (URISyntaxException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		_log.info("Crawled Data.");
		
		_log.info("Starting DS.");
		LDRetriever retriever = new LDRetriever();
		
		_log.info("Starting population of DS.");
		retriever.populateDataset(outputFilename);
		_log.info("Populated DS.");
		
		_log.info("Let's test some querys...");
		retriever.test();
		_log.info("Tests completed");



		
	}

}